hackerrank day 0 weighted mean problem solution in python programming